const express = require('express')
const router = express.Router()
const user_handler = require('../router_handler/user')
//导入验证表单数据的中间件
const validator = require('../util/validator')
const { update_userinfo_schema,update_password_schema,update_avatar_schema } = require('../schema/user')

//获取用户的基本信息
router.get('/userinfo',user_handler.getUserInfo)
//更新用户信息
router.post('/updateUserinfo',validator.body(update_userinfo_schema),user_handler.updateUserInfo)
//重置密码
router.post('/updatePassword',validator.body(update_password_schema),user_handler.updatePassword)
//更换头像
router.post('/updateAvatar', validator.body(update_avatar_schema),user_handler.updateAvatar)

module.exports = router
